<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>合约设置</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 数据列表 -->
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column type="index" label="#"> </el-table-column>
      <el-table-column prop="id" label="ID" width="80"> </el-table-column>
      <el-table-column prop="gmNum" label="合约价格USDT"> </el-table-column>
      <el-table-column prop="zyNum" label="质押金额DFH"> </el-table-column>
      <el-table-column prop="pdDay" label="排队时间"> </el-table-column>
      <el-table-column prop="hyDay" label="周期"> </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="primary"
            icon="el-icon-edit"
            @click="edit(scope.row.id,scope.row.gmNum)"
            >编辑</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-dialog title="修改排队时间" :visible.sync="dialogFormVisible" @close="closeForm">
      <el-form :model="form"  ref="changeForm">
        <el-form-item label="合约价格">
          <el-input v-model="form.name" disabled></el-input>
        </el-form-item>
        <el-form-item label="排队时间">
          <el-input
            v-model="form.pdDay"
           
            placeholder="限制数字1-15"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button type="primary" @click="editTrue">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      id:'',
      queryinfo: {
        userTel: "",
        userEmail: "",
        pageIndex: 1,
        pageSize: 10,
      },
      tableData: [],
      dialogFormVisible: false,
      form: {
        name: "",
        pdDay : "",
        id:'',
      },
    };
  },
  created() {
    this.getmsgList();
  },
  methods: {
    // 关闭对话框重置对话框
    closeForm(){
      this.form.pdDay=''
    },
    //   点击确认发送请求
    async editTrue() {
      const { data: res } = await this.$http.post(
        "currencyAudit/updatePdDay",
        this.httputil(this.form)
      );
      if (res.code !== 200) return this.$message.error(res.msg);
      this.$message.success(res.msg);
      this.dialogFormVisible = false;
      this.getmsgList();
    },
    // 获取数据列表
    async getmsgList() {
      const { data: res } = await this.$http.post(
        "currencyAudit/getOrderList",
      );
      if (res.code !== 200) return this.$message.error(res.msg);
      this.tableData = res.data;
      this.total = res.data.count;
    },
    // 编辑
    edit(id,mun) {
      this.form.id=id
      this.form.name=mun
      this.dialogFormVisible = true;
    },
  },
};
</script>
